package com.learn.sqlSession;

import com.learn.pojo.User;

import java.util.List;

public interface SqlSession {
    /**
     * /查询所有
     * @param statementId
     * @param params
     * @param <E>
     * @return
     * @throws Exception
     */
    public <E> List<E> selectList(String statementId, Object... params) throws Exception;

    /**
     * 查询单条记录
     * @param statementId
     * @param params
     * @param <T>
     * @return
     * @throws Exception
     */
    public <T> T selectOne(String statementId, Object... params) throws Exception;

    /**
     * 插入数据
     * @param statementId
     * @param params
     * @throws Exception
     */
    public void insert(String statementId,Object... params)throws Exception;

    /**
     * 更新数据
     * @param statementId
     * @param params
     * @throws Exception
     */
    public void update(String statementId,Object... params)throws Exception;

    /**
     * 删除数据
     * @param statementId
     * @param params
     * @throws Exception
     */
    public void delete(String statementId,Object... params)throws Exception;

    /**
     * /为Dao接口生产代理实现类
     * @param mapperClass
     * @param <T>
     * @return
     */
    public <T> T getMapper(Class<?> mapperClass);

}
